package com.zzw.listener;

import com.zzw.utils.RedisUtil;
import com.zzw.utils.WebUtils;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * @author 赵志伟
 * @version 1.0
 */
@SuppressWarnings({"all"})
public class ZzwHttpSessionListener implements HttpSessionListener {
    @Override
    public void sessionCreated(HttpSessionEvent se) {
        HttpSession session = se.getSession();

        session.setMaxInactiveInterval(60 * 30);

        WebUtils.session.set(session);
        System.out.println("监听到session");
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {

    }
}
